home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / basic / apb17.zip / APBTOAS.ASM < prev    next >
Assembly Source File  |  1990-12-20  |  2KB  |  68 lines

  1.     Title ApBasic to As86M interface sub-program
  2.     Page 60,130
  3.  
  4. Comment *
  5.     Created 10-20-1987 k. murray
  6.  
  7.     AutoSort/86M is a excellant sort/merge package published by
  8.     Computer Control Systems, Inc. Tele: (904) 752-0912
  9.     They also publish btree+ system called Fabs Plus. For further
  10.     information contact Comptech or Computer Control Systems.
  11.  
  12. *
  13.  
  14. Cseg    Segment byte public 'Code'
  15.     Assume Cs:Cseg,Ds:nothing,Es:nothing
  16. ;
  17. Comment *
  18.     Define in program:
  19.         Sub As86m Cmd$,Reccnt%,ErCode%,Asseg% External "ApbToAs.com"
  20.     Call in program:
  21.         As86m Cmd$,RcLo%,ErCode%,Asseg%
  22.         As86m "X",RcHi%,Dum%,Asseg%
  23.         RecCnt#=CVL(MKI$(RcLo%)+MKI$(RcHi%))
  24.  
  25.     Stack frame:
  26.     Bp+12    Cmd$ desc #
  27.     Bp+10    Adr. of Reccnt%
  28.     Bp+8    Adr. of ErCode%
  29.     Bp+6    Adr. of Asseg%
  30.     Bp+4    Return Segment
  31.     Bp+2    Return Offset
  32.     Bp+0    Saved Bp
  33. *
  34. Start:
  35. As86m Proc Far
  36.     Push    Bp
  37.     Mov    Bp,Sp
  38.     Mov    Bx,[Bp+12]        ; Get desc # of Cmd$
  39.     Shl    Bx,1
  40.     Shl    Bx,1            ; Mult by 4
  41.     Mov    Es,Ds:[6]        ; Get desc segment
  42.     Mov    Ax,Es:[Bx]        ; get length of string in Ax
  43.     Mov    Es,Es:[Bx+2]        ; Put segment of string in Es
  44.     Push    Es:[0]            ; save reserved area before string
  45.     Push    Ax            ; save extra because FABS remove 12
  46.     Mov    Es:[1],Al        ; put length as byte before string
  47.     Push    Es            ; push segment of string data
  48.     Mov    Ax,1
  49.     Push    Ax            ; offset of string (1)
  50.     Push    Ds            ; segment of ErCode%
  51.     Push    [Bp+8]            ; Offset of ErCode%
  52.     Mov    Bx,[Bp+6]        ; Adr. of Asseg%
  53.     Mov    Ax,[Bx]            ; Asseg% into Ax
  54.     Mov    word ptr Cs:Asseg+2,Ax    ; put segment into local variable
  55.     Call    dword ptr Cs:Asseg    ; do call to as86m
  56.     Mov    Bx,[Bp+10]        ; adr. to put Reccnt%
  57.     Mov    [Bx],Ax            ; save returned Reccnt%
  58.     Pop    Es:[0]            ; restore reserved area
  59.     Pop    Bp
  60.     Ret    4*2            ; four parm's at 2 bytes/parm
  61. As86m    Endp
  62. ;
  63. ;    Local data goes here
  64. Asseg    Dw    12,0
  65. ;
  66. Cseg    Ends
  67.     End    Start
  68.